home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1989 February / 64er_Magazin_89-02_1989_Markt__Technik_de_Disk_2_of_2_Side_A.d64 / easy triangles (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  119 lines

  1. 100 rem *******************************
  2. 110 rem *     easy triangles v1.0     *
  3. 120 rem *-----------------------------*
  4. 130 rem * (w) by f. schneider in 1988 *
  5. 140 rem * (c) 64'er (markt & technik) *
  6. 150 rem *******************************
  7. 160 :
  8. 170 s0$="         =":s1$="     "+s0$:s2$="[146][211]eite ":s3$="[146][215]inkel "
  9. 180 s4$="[211]eitenhalbierende ":s5$="[215]inkelhalbier. ":s6$="alpha":s7$="beta "
  10. 190 s8$="gamma":s9$="[200]oehe auf "+s2$:goto520
  11. 200 rem --- rechenunterroutinen
  12. 210 n=a:p=x
  13. 220 m=n*sin((NULL)*o/f)/sin((NULL)*p/f):return
  14. 230 m=(n^2+o^2-p^2)/(2*n*o):ifm>=1orm<=-1goto700
  15. 240 m=(-atn(m/sqr(1-m^2))+(NULL)/2)*f/(NULL):return
  16. 250 m=sqr(n^2+o^2-2*n*o*cos((NULL)*p/f)):return
  17. 260 ifn<othenpoke2,2
  18. 270 m=o*sin((NULL)*p/f)/n:m=m+1:m=m-1:ifm=1thenm=90:return
  19. 280 ifm>1goto700
  20. 290 m=atn(m/sqr(1-m^2))*f/(NULL):return
  21. 300 m=n*sin((NULL)*o/f)/(sin((NULL)*(f-p/2-o)/f)):return
  22. 310 rem --- verzoegerung / tastatur
  23. 320 fori=0to1500:next:goto520
  24. 330 poke198,0
  25. 340 geta$:ifa$=""goto340
  26. 350 return
  27. 360 rem --- systemroutinen
  28. 370 d=d-1:ifpeek(e-d)=1thenprint"";
  29. 380 return
  30. 390 ifa<>0theno=a:gosub260:x=m:goto910
  31. 400 return
  32. 410 ifm<0thengoto670
  33. 420 e=e+1:ifm<>0thenpokee,1:d=d+1:ife>=2027thend=d+3
  34. 430 return
  35. 440 print"[146] --------------------------------------":return
  36. 450 print" "s2$"a"s1$;:return
  37. 460 print" [159]"s2$"b"s1$;:return
  38. 470 print" [153]"s2$"c"s1$;:return
  39. 480 print" [153]"s3$s6$s0$;:return
  40. 490 print" [159]"s3$s7$s0$;:return
  41. 500 print" "s3$s8$s0$;:return
  42. 510 rem --- hauptprogramm
  43. 520 poke53280,0:poke53281,0:poke53272,23:poke657,128:poke198,0:poke2,1
  44. 530 fori=2024to2029:pokei,0:next:a=0:b=0:c=0:d=0:e=2023:f=180:x=0:y=0:z=0
  45. 540 print"[147]"tab(10)"[197]asy [212]riangles v1.0"
  46. 550 printtab(6)"(w) by [198]. [211]chneider in 1988":gosub450
  47. 560 inputa:m=a:print:gosub410:gosub460:inputb:m=b:print:gosub410:gosub470:inputc:m=c
  48. 570 print"":gosub410:gosub480:inputx:m=x:print:gosub410:gosub490:inputy:m=y:print
  49. 580 gosub410:gosub500:inputz:m=z:print:gosub410
  50. 590 rem --- eingabe pruefen
  51. 600 ifx>=180ory>=180orz>=180orx+y>=180ory+z>=180orx+z>=180goto670
  52. 610 ifd=9goto910
  53. 620 ifd=6goto780
  54. 630 ifd=3goto730
  55. 640 ifd<3ord=4ord=5ord=8goto680
  56. 650 ifd=7ord=10ord=11ord>12goto690
  57. 660 rem --- systemmeldungen
  58. 670 print""tab(10)"unzulaessige [215]erte !":goto320
  59. 680 print""tab(10)"zu wenig [208]arameter !":goto320
  60. 690 print""tab(9)"nur 3 [215]erte eingeben !":goto320
  61. 700 print"[147]"tab(12)"keine [204]oesung !":gosub330:goto520
  62. 710 rem --- rechenroutinen
  63. 720 rem --- 3 seiten
  64. 730 ifx=0thenn=b:o=c:p=a:gosub230:x=m
  65. 740 ify=0thenn=a:o=c:p=b:gosub230:y=m
  66. 750 ifz=0thenn=a:o=b:p=c:gosub230:z=m
  67. 760 goto1010
  68. 770 rem --- 2 seiten + eing. winkel
  69. 780 ifa<>0andb<>0andz<>0thenn=a:o=b:p=z:gosub250:c=m:goto730
  70. 790 ifb<>0andc<>0andx<>0thenn=b:o=c:p=x:gosub250:a=m:goto730
  71. 800 ifa<>0andc<>0andy<>0thenn=a:o=c:p=y:gosub250:b=m:goto730
  72. 810 rem --- 2 seiten + 1 winkel
  73. 820 ifx<>0thenn=a:p=x:goto840
  74. 830 goto860
  75. 840 ifb<>0theno=b:gosub260:y=m:goto910
  76. 850 o=c:gosub260:z=m:goto910
  77. 860 ify<>0thenn=b:p=y:gosub390:goto880
  78. 870 goto890
  79. 880 o=c:gosub260:z=m:goto910
  80. 890 n=c:p=z:gosub390:o=b:gosub260:y=m
  81. 900 rem --- 1 seite + 2 winkel
  82. 910 w=f-x-y-z
  83. 920 ifx=0thenx=w
  84. 930 ify=0theny=w
  85. 940 ifz=0thenz=w
  86. 950 ifc<>0thenn=c:p=z:goto980
  87. 960 ifb<>0thenn=b:p=y:goto980
  88. 970 ifa<>0theno=y:gosub210:b=m:goto990
  89. 980 o=x:gosub220:a=m:ifb=0theno=y:gosub210:b=m:goto1010
  90. 990 o=z:gosub210:c=m
  91. 1000 rem --- hoehen/s.-halb./w.-halb.
  92. 1010 ha=b*sin((NULL)*z/f):hb=c*sin((NULL)*x/f):hc=a*sin((NULL)*y/f):n=a/2:o=c:p=y:gosub250:sa=m
  93. 1020 n=b/2:o=a:p=z:gosub250:sb=m:n=c/2:o=b:p=x:gosub250:sc=m:n=c:o=y:p=x:gosub300
  94. 1030 wal=m:n=a:o=z:p=y:gosub300:wbe=m:n=b:o=x:p=z:gosub300:wga=m:um=a+b+c
  95. 1040 fl=.5*a*b*sin((NULL)*z/f)
  96. 1050 rem --- loesungen ausgeben
  97. 1060 d=6:g=65:ifpeek(2)=3theng=66
  98. 1070 print"[147]"tab(9)"[204]oesungen "chr$(g)":":gosub450:gosub370:printa:gosub460
  99. 1080 gosub370:printb:gosub470:gosub370:printc:gosub440:gosub480:gosub370:printx
  100. 1090 gosub490:gosub370:printy:gosub500:gosub370:printz:gosub440
  101. 1100 print" "s9$"a    ="ha:print" [159]"s9$"b    ="hb:print" [153]"s9$"c    ="hc:gosub440
  102. 1110 print" [153]"s4$"a  ="sa:print" [159]"s4$"b  ="sb:print" "s4$"c  ="sc:gosub440
  103. 1120 print" "s5$s6$" ="wal:print" [159]"s5$s7$" ="wbe:print" [153]"s5$s8$" ="wga:gosub440
  104. 1130 print" [153][198]laecheninhalt       ="fl:print" [159][213]mfang "s1$um:gosub330:close1
  105. 1140 ifa$="[136]"thenopen1,4,0:cmd1:goto1060
  106. 1150 ifpeek(2)<>2goto520
  107. 1160 rem --- 2. loesung bei ssw(k)
  108. 1170 poke2,3:ifpeek(e-2)=1goto1210
  109. 1180 ifpeek(e-1)=1goto1230
  110. 1190 ifpeek(e-5)=1thenb=0:y=0:goto1270
  111. 1200 a=0:x=0:goto1260
  112. 1210 ifpeek(e-4)=1thenc=0:z=0:goto1260
  113. 1220 b=0:y=0:goto1250
  114. 1230 ifpeek(e-5)=1thenc=0:z=0:goto1270
  115. 1240 a=0:x=0
  116. 1250 z=f-z:goto910
  117. 1260 y=f-y:goto910
  118. 1270 x=f-x:goto910
  119.